package zadanie.s14homerowk.src.streams;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MainClass {

	public static void main(String[] args) throws IOException {
		File outFile = new File("output.txt");
		outFile.createNewFile();
		InputStream in = new FileInputStream("input.txt");
		OutputStream out = new FileOutputStream(outFile);
		OutputStream replaceOut = new ReplacerOutputFilter(out, ' ', '|');
		Integer data = null;
		while ((data = in.read()) != -1) {
			replaceOut.write(data);
		}
		in.close();
		out.close();
		System.out.println("Done!");

	}

}
